home *** CD-ROM | disk | FTP | other *** search
- global stageHeight, stageWidth, VMiddle, HMiddle, leftStop, rightStop, topStop, bottomStop, speed, mapList, mag, minMag, maxMag, aspect, hotSpotSize, currentOnSite, held
-
- on startMovie
- set the blend of sprite 34 to 0
- member(the memberNum of sprite 1).centerRegPoint = 1
- cursor(2)
- stageHeight = the stageBottom - the stageTop
- stageWidth = the stageRight - the stageLeft
- VMiddle = stageHeight / 2
- HMiddle = stageWidth / 2
- speed = 6.0
- aspect = 1.25
- mag = 1.0
- minMag = 0.20000000000000001
- maxMag = 0.69999999999999996
- hotSpotSize = 45
- held = 0
- mapList = [11: [11, point(1392, 1657), "Abbey & Heritage Vaults", "Abbey"], 12: [12, point(962, 687), "Assembly Rms. & Mus. of Costume", "Assembly_Rooms"], 13: [13, point(1287, 1129), "Bath Postal Museum", "Postal_Museum"], 14: [14, point(1204, 544), "Building of Bath Museum", "Bath_Museum"], 15: [15, point(1406, 1518), "Guildhall", "Guildhall"], 16: [16, point(2340, 845), "Holburne Museum of Art", "Art_Museum"], 17: [17, point(872, 1088), "Jane Austen Centre", "Jane_Austen"], 18: [18, point(858, 1628), "Impossible Microworld", "Micro_World"], 19: [19, point(1280, 1716), "Pump Room", "Pump_Room"], 20: [20, point(1002, 286), "Museum of Bath at Work", "Work_Museum"], 21: [21, point(804, 622), "Museum of East Asian Art", "Asian_Museum"], 22: [22, point(1215, 1780), "New Spa", "New_Spa"], 23: [23, point(223, 534), "Royal Crescent & Circus", "Royal_Crescent"], 24: [24, point(1530, 1376), "Pulteney Bridge", "Pulteney_Bridge"], 25: [25, point(1531, 1784), "Sally Lunn's House", "Sally_Lunn"], 26: [26, point(1368, 1398), "Victoria Art Gallery", "Victoria"], 27: [27, point(1358, 1734), "Roman Baths", "Roman_Baths"], 28: [28, point(372, 617), "No. 1 Royal Crescent", "No1"]]
- zoom(0.5)
- zoom(1.00099999999999989)
- end
-
- on deactivateWindow
- tell the stage
- bringMapToFront()
- end tell
- end
-
- on enterFrame me
- if rollover(1) and (sprite(1).memberNum <> 6) then
- if the rightMouseDown = 0 then
- vOffset = curve(VMiddle - the mouseV, VMiddle) / speed
- hOffset = curve(HMiddle - the mouseH, HMiddle) / speed
- move(hOffset, vOffset)
- end if
- else
- sprite(2).visible = 0
- end if
- end
-
- on curve x, scale
- if x >= 0 then
- return power(x, 2) / scale
- else
- return power(x, 2) / scale * -1
- end if
- end
-
- on move x, y
- if held then
- return
- end if
- resetState()
- hScale = member(the memberNum of sprite 1).width / float(sprite(1).width)
- vScale = member(the memberNum of sprite 1).height / float(sprite(1).height)
- leftStop = HMiddle * hScale
- rightStop = member(the memberNum of sprite 1).width - (HMiddle * hScale)
- topStop = VMiddle * vScale
- bottomStop = member(the memberNum of sprite 1).height - (VMiddle * vScale)
- newX = getAt(member(the memberNum of sprite 1).regPoint, 1) - x
- newY = getAt(member(the memberNum of sprite 1).regPoint, 2) - y
- member(the memberNum of sprite 1).regPoint = point(max(min(newX, rightStop), leftStop), max(min(newY, bottomStop), topStop))
- showHotspots()
- end
-
- on showHotspots
- mapOrigin = point(sprite(1).left, sprite(1).top)
- scale = sprite(1).width / float(member("Map").width)
- repeat with i in mapList
- set the loc of sprite getAt(i, 1) to (getAt(i, 2) * scale) + mapOrigin
- set the width of sprite getAt(i, 1) to scale * hotSpotSize
- set the height of sprite getAt(i, 1) to scale * hotSpotSize
- end repeat
- end
-
- on zoom x
- if held then
- return
- end if
- if ((x < 1) and (mag > minMag)) or ((x > 1) and (mag < maxMag)) then
- set the width of sprite 1 to max(sprite(1).width * x, stageWidth)
- set the height of sprite 1 to sprite(1).width * aspect
- mag = mag * x
- move(0, 0)
- end if
- updateStage()
- end
-
- on gotoSite site
- if findPos(mapList, site) = VOID then
- return
- end if
- p = getAt(getaProp(mapList, site), 2)
- p = p * member(the memberNum of sprite 1).width / member(4).width
- member(the memberNum of sprite 1).regPoint = p
- move(0, 0)
- set the member of sprite site to member("node_over")
- set the blend of sprite site to 100
- str = getAt(getaProp(mapList, site), 3)
- member("label").text = str
- currentOnSite = site
- end
-
- on resetState
- if currentOnSite <> VOID then
- set the member of sprite currentOnSite to member("hotSpot")
- set the blend of sprite currentOnSite to 0
- member("label").text = EMPTY
- currentOnSite = VOID
- end if
- end
-
- on translateReg source, dest
- x = member(dest).width / float(member(source).width) * getAt(member(source).regPoint, 1)
- y = member(dest).height / float(member(source).height) * getAt(member(source).regPoint, 2)
- member(dest).regPoint = point(x, y)
- end
-
- on rightMouseDown me
- startPos = the mouseV
- repeat while the rightMouseDown = 1
- offset = the mouseV - startPos
- zoom(1 - (offset / 1000.0))
- end repeat
- end
-
- on keyDown
- if the keyCode = 125 then
- zoom(0.98999999999999999)
- else
- if the keyCode = 126 then
- zoom(1 / 0.98999999999999999)
- end if
- end if
- end
-
- on toggleKey
- if the frame = 10 then
- go(15)
- held = 1
- else
- go(21)
- held = 0
- end if
- end
-
- on showLabel str
- put str
- pass()
- end
-
- on jumpToSite site
- put site
- pass()
- end
-